package com.zmn.oms.zmn.normal.business.interfaces.part;

import com.zmn.common.dto2.ResponseDTO;
import com.zmn.oms.common.exception.OmsBaseException;
import com.zmn.oms.model.dio.part.OrderPartReviewDIO;
import com.zmn.oms.model.dto.part.*;
import com.zmn.oms.model.dto.work.modify.OrderNewMachinePartListDTO;
import com.zmn.oms.model.dto.work.modify.must.ZsPartDTO;
import com.zmn.oms.model.entity.work.OrderWork;
import com.zmn.oms.model.vo.part.PartReimburseVO;
import com.zmn.oms.model.vo.work.modify.must.ZsPartVO;
import com.zmn.scm2.common.model.dro.wms.goods.WmsGoodsDRO;

import java.util.List;

/**
 * 类描述：啄木鸟-普通工单-工单配件
 *
 * @author heciqi
 * @date 2018/11/28 19:35
 */
public interface ZsNormalOrderPartBService {
	/**
	 * 查询核配件操作
	 * @param orderId
	 * @param workId
	 * @return
	 */
	ZsPartVO findPartVo(Long orderId, Long workId) throws OmsBaseException;

	/**
	 * 校验工单配件指标
	 * @param zsPartDTO
	 * @return
	 * @throws OmsBaseException
	 */
	ResponseDTO checkGoodsIndicators(ZsPartDTO zsPartDTO) throws OmsBaseException;

	/**
	 * 保存核配件
	 * @param zsPartDTO
	 */
	ResponseDTO savePart(ZsPartDTO zsPartDTO) throws OmsBaseException;

	/**
	 * 取消配件
	 * @param zsPartDTO
	 */
	ResponseDTO cancelPart(ZsPartDTO zsPartDTO) throws OmsBaseException;

	/**
	 * 根据工单id查询
	 *
	 * @param orderId
	 * @return
	 */
	OrderPartDTO listByOrderId(Long orderId);

	/**
	 * 根据工单id，工程师id查询
	 *
	 * @param orderId
	 * @param masterId
	 * @return
	 */
	SingleMasterOrderPartDTO listByOrderIdAndMaster(Long orderId, Integer masterId);

	/**
	 * 处理配件审核
	 * @param orderPartReviewDIO
	 */
	void modifyOrderPartReview(OrderPartReviewDIO orderPartReviewDIO);

	/**
	 * 新增外报配件
	 * @param addOrderPartDTO
	 */
	void insertOutOrderPart(AddOrderPartDTO addOrderPartDTO);

	/**
	 * 新增订单杂项费用
	 * @param addOrderPartDTO
	 */
	void insertDeliverOrderPart(AddOrderPartDTO addOrderPartDTO);

	/**
	 * 配件报销，包含外报配件和运杂费
	 * @param partReimburseDTO 
	 * @return void
	 * @author wangxiaokun
	 */
	void insertReimburseOrderPart(PartReimburseDTO partReimburseDTO);

	/**
	 * 新增厂商配件信息
	 * @param orderNewMachinePartListDTO
	 * @return void
	 * @author wangxiaokun
	 */
	void addNewMachinePartList(OrderNewMachinePartListDTO orderNewMachinePartListDTO) throws OmsBaseException;

	/**
	 * 清空工单配件（工单配件，退回工程师库房，更新工单金额）
	 * @param orderId
	 */
	 void clearOrderPart(Long orderId);
	 
	 /**
	  * 取消配件报销（外报、运杂）
	  * @param orderId
	  * @param reimburseId
	  * @return void
	  * @author wangxiaokun
	  */
	 void clearOrderPartByOrderIdAndReimburseId(Long orderId, String reimburseId);

	/**
	 * 配件报销
	 * @param orderId
	 * @return
	 */
	List<PartReimburseVO> listPartReimburseByOrderId(Long orderId);

	/**
	 * 配件报销
	 * @param orderId
	 * @return
	 */
	void updatePartDetectionResult(PartDetectionResultDTO resultDTO);

	/**
	 * 配件使用情况
	 * @param orderWork
	 * @return
	 * @throws OmsBaseException
	 */
	Integer getPartUseType(OrderWork orderWork) throws OmsBaseException;
}
